from pydantic import BaseModel
from typing import Optional
from .chat_record import ContentType, Role

class SearchRequest(BaseModel):
    saasId: str
    userId: str
    keyWord: str
    contentType: Optional[ContentType] = None
    role: Optional[Role] = None
    topk: Optional[int] = 5
    alpha: Optional[float] = 0.4,
    min_score: Optional[float] = 1
    type: Optional[str] = None
    date: Optional[str] = None

class EncryptionRequest(BaseModel):
    saasId:str
    strs:list[str]



class SearchResponse(BaseModel):
    chatHistory: str


#公共返回类
class CommonResponse(BaseModel):
    status: str="200"
    data: object
    msg: str="操作成功"

class SearchImgResponse(BaseModel):
    id: str
    url: str
    describe: str



class SaveChatRequest(BaseModel):
    saasId: str
    userId: str
    contentType: ContentType
    content: str
    role: Role
    contentDes: Optional[str] = None



class SaveImgTextRequest(BaseModel):
    saasId: str
    userId: str
    url: str
    discribe: str

class SaveMemoryRequest(BaseModel):
    userId: str
    saasId: str
    type:str=None
    sec_type: str = None
    content: str=None
    optimizedContent: str = None,
    happenTime: str = None,
    title: str = None,
    relation: str = None
    detail: str = None

class SaveChatResponse(BaseModel):
    status: str
    recordId: str=None

class SaveMemoryResponse(BaseModel):
    optimizedContent: str
    type: str
    sec_type: str
    recordId: str